local g=6000 local t=300 local r=2.5 local y={-1,1} local w=250 local n=20 local x=3000 local I=300 local j=3000 local k=2000 local q=BrickColor.Gray() local o=true local m=.2 local l=.1 local p=BrickColor.Black() local u=8 local N="AWD" local s=.8 local z=Vector3.new(1.2,3,3) local v=2 local i=.3 local h=8 local e=250 local d=1e9 local F=40 local f="rbxassetid://870636634" local D=1.5 local c=.3 local G=.3 local a=1.4 local E=-1 local A=-4 local b=game:GetService("Players") local C=game:GetService("RunService") local _=0 local O={} local B={} function O:CreateObject(_,a)local b=Instance.new(_) for _,a in pairs(a)do b[_]=a end return b end function B.wait(a)a=a or 0.05 local _=os.clock() while os.clock()-_W: Forward\n","KeyBoard>S: Brake\n","Keyboard>A/D: Steer\n","Keyboard>E: Shift Forward\n","Keyboard>Q: Shift Reverse\n","\n","Drive safely and wear your seatbelt!"} local f=false local k={} local b={} local l={} local H={} local E=nil local q=nil local B="" local G=0 local t=0 local j=0 local s=Vector3.new(0,0,0) local v=0 local x=0 local n=0 local m=0 local i=0 local w=0 local h=0 local e=0 local d=0 local c=0 local C=0 local z=0 local F=0 local D=1 local p=false local u=false local y=false local g=script:WaitForChild("MainEvent") local A={} function A:CreateObject(a,_)local b=Instance.new(a) for a,_ in pairs(_)do b[a]=_ end return b end local function o(a,_)if not _ then if a.KeyCode==Enum.KeyCode.R and a.UserInputState==Enum.UserInputState.Begin and not y then y=true q.MaxTorque=Vector3.new(1e7,1e7,1e7) wait(3) q.MaxTorque=Vector3.new(0,0,0) wait(3) y=false elseif a.KeyCode==Enum.KeyCode.W then if a.UserInputState==Enum.UserInputState.Begin then C=1 else C=0 end elseif a.KeyCode==Enum.KeyCode.S then if a.UserInputState==Enum.UserInputState.Begin then z=1 else z=0 end elseif a.KeyCode==Enum.KeyCode.D then if a.UserInputState==Enum.UserInputState.Begin then F=1 u=true else if p then F=-1 else F=0 end u=false end elseif a.KeyCode==Enum.KeyCode.A then if a.UserInputState==Enum.UserInputState.Begin then F=-1 p=true else if u then F=1 else F=0 end p=false end elseif a.KeyCode==Enum.KeyCode.E then if a.UserInputState==Enum.UserInputState.Begin then D=1 G=t end elseif a.KeyCode==Enum.KeyCode.Q then if a.UserInputState==Enum.UserInputState.Begin then D=-1 G=j end end end end local p="" for _,_ in pairs(a)do p=p.._ end print(p) H.MainGui=A:CreateObject("ScreenGui",{Name="CarGui",ZIndexBehavior=Enum.ZIndexBehavior.Sibling}) H.Gear=A:CreateObject("TextBox",{Name="Gear",BackgroundTransparency=1,Position=UDim2.new(.8,0,.8,0),Size=UDim2.new(.1,0,.1,0),Font=Enum.Font.Gotham,Text="Gear: 1",TextScaled=true,TextColor3=Color3.new(1,1,1),TextStrokeTransparency=.8}) H.Aspect=A:CreateObject("UIAspectRatioConstraint",{Name="Aspect",AspectRatio=2,AspectType=Enum.AspectType.FitWithinMaxSize,DominantAxis=Enum.DominantAxis.Width}) H.Aspect.Parent=H.Gear H.Gear.Parent=H.MainGui H.MainGui.Parent=script g.OnClientEvent:Connect(function(_,...)if _=="info"then f=true E=(...)[1] k=(...)[2] b=(...)[3] B=(...)[4] G=(...)[5] s=(...)[6] v=(...)[7] x=(...)[8] m=(...)[9] n=(...)[10] i=(...)[11] w=(...)[12] q=(...)[13] h=(...)[14] e=(...)[15] l=(...)[16] j=(...)[17] t=G end end) while not f do wait()end r.InputBegan:Connect(o) r.InputChanged:Connect(o) r.InputEnded:Connect(o) _.Heartbeat:Connect(function()d=(v-m)*(E.AssemblyLinearVelocity.Magnitude/i) c=(w-n)*(E.AssemblyLinearVelocity.Magnitude/t) if D==-1 then H.Gear.Text="Gear: R"else H.Gear.Text="Gear: "..D end for _,a in pairs(k)do if _=="FLMotor"or _=="RLMotor"then a.AngularVelocity=C*(G/(s.Y/2))*D E.MaxSpeed=G if(_=="FLMotor"and B=="RWD")or(_=="RLMotor"and B=="FWD")then a.MotorMaxTorque=0 else a.MotorMaxTorque=x*C end else a.AngularVelocity=-(C*(G/(s.Y/2)))*D E.MaxSpeed=G if(_=="FRMotor"and B=="RWD")or(_=="RRMotor"and B=="FWD")then a.MotorMaxTorque=0 else a.MotorMaxTorque=x*C end end end for _,a in pairs(l)do if _=="FLBrake"or _=="FRBrake"then a.MotorMaxTorque=h*z else a.MotorMaxTorque=e*z end end for _,_ in pairs(b)do _.TargetAngle=-((v-d)*F) _.AngularSpeed=w-c end end) E.Changed:Connect(function(_)if _=="Occupant"then if not E.Occupant then g:FireServer("destroy")end end end) ]],b.PlayerGui) _.Parent=a B.wait(1) _:FireClient(b,"info",{Q.Seat,J,H,N,w,z,F,x,h,i,e,v,M.Flip,j,k,K,n}) Q.Seat.Changed:Connect(function(_)if _=="Occupant"and not Q.Seat.Occupant then a:Destroy()end end)end end end end) C.Stepped:Connect(function()M.Sound.Playing=Q.Seat.Occupant if Q.Seat.Throttle==1 then M.Sound.Volume=D else M.Sound.Volume=c end M.Sound.PlaybackSpeed=(a-G)*(Q.Seat.AssemblyLinearVelocity.Magnitude/w)+G end)